﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MapLibrary.Players.Skills;
using GUILibrary;

namespace MapLibrary.Players
{
    public class PlayerData
    {

        public PlayerData()
        {
            //temporary
            SkillData = new List<SkillData>();
            ActivatedAbilities = new List<bool>();
            ProteinAmounts = new List<IntWrapper>();

            for (int i = 0; i < 3; i++)
            {
                ProteinAmounts.Add(new IntWrapper(400));
            }

            //load the 3 different skill datas.
            for (int i = 0; i < 4; i++)
            {
                SkillData temp = new SkillData();
                temp.ProteinAmounts = new List<IntWrapper>();
                temp.ProteinToLevel = new List<IntWrapper>();

                for (int j = 0; j < 4; j++)
                {
                    temp.ProteinAmounts.Add(new IntWrapper(0));
                    temp.ProteinToLevel.Add(new IntWrapper(100));
                }

                temp.CurrentLevel = new IntWrapper(1);

                SkillData.Add(temp);
            }
        }

        /// <summary>
        /// Returns the proper SkillData element in the SkillData list
        /// that corresponds to the provided name.
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        public SkillData GetSkillDataByName(string name)
        {
            if (name.Equals("PowerShield"))
                return SkillData[0];
            else if (name.Equals("Explosion"))
                return SkillData[1];
            else if (name.Equals("Net"))
                return SkillData[2];
            else if (name.Equals("Laser"))
                return SkillData[3];
            else
                return null;
        }

        public List<SkillData> SkillData
        {
            get;
            set;
        }

        public List<bool> ActivatedAbilities
        {
            get;
            set;
        }

        public List<IntWrapper> ProteinAmounts
        {
            get;
            set;
        }
    }
}
